package com.daily.DailyStudy.Shallow2DeepCopy;

import lombok.Data;

@Data
public class Book implements Cloneable{

    private String book_name;

    private String book_price;


    /**
     * 浅拷贝不需要实现Cloneable接口，深拷贝需要
     * */
    @Override
    protected Object clone(){
        try{
            return super.clone();
        }catch (CloneNotSupportedException e){
            return null;
        }
    }
}
